//
//  ZTCommon.m
//  ZHYYTool
//
//  Created by MT-SW-005 on 2021/11/4.
//  Copyright © 2021 MT-SW-005. All rights reserved.
//

#import "ZTCommon.h"

@implementation ZTCommon

/**
 [0-1]之间的小数
 */
+(float)randomFloat
{
    float f = (float)(arc4random()%1000000) / 1000000 ;
    return f;
}

/**
 * 通过arc4random() 获取[0,x)之间的整数
 */
+(int)randomZerotoX:(int)x
{
    int value = arc4random() % x;
    return value;
}


/**
 * 获取[start,end]之间的整数:
*/
+(int)randomFrom:(int)start toEnd:(int)end
{
    int vaule = arc4random() % (end - start + 1) + start;
    return vaule;
}

@end
